package com.dianxin.smartpark.web.attendance;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.chinatelecom.response.common.CommonResponseBody;
import com.dianxin.smartpark.dao.qo.attendance.SmartParkAttendanceApproveQO;
import com.dianxin.smartpark.service.attendance.SmartParkAttendanceApproveService;
import com.dianxin.smartpark.service.vo.attendance.SmartParkAttendanceApproveVO;
import com.dianxin.sso.client.annotation.RecordLog;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 考勤审批
 * @program: smart-park
 * @description: 考勤审批
 * @author: chenyong
 * @create: 2021-08-10 16:40
 */
@RestController
@RequestMapping("/smartpark/attendance/attendanceApprove")
public class SmartParkAttendanceApproveController {

    @Resource
    private SmartParkAttendanceApproveService smartParkAttendanceApproveService;

    /**
     * 分页查询
     * @Description:  分页查询
     * @Author: ChenYong
     * @Date: 2021/8/10 0010
     * @param smartParkAttendanceApproveQO:
     * @Return: CommonResponseBody<List<SmartParkAttendanceApproveVO>>
     */
    @PostMapping("/getAttendanceApproves")
    @RecordLog(name = "考勤审批查询")
    @SaCheckPermission("/attendance/attendanceApprove/getAttendanceApproves")
    public CommonResponseBody<List<SmartParkAttendanceApproveVO>> getAttendanceApproves(@RequestBody SmartParkAttendanceApproveQO smartParkAttendanceApproveQO){
        return smartParkAttendanceApproveService.getAttendanceApproves(smartParkAttendanceApproveQO);
    };

    /**
     * 审批添加
     * @Description:  审批添加
     * @Author: ChenYong
     * @Date: 2021/8/10 0010
     * @param smartParkAttendanceApproveQO:
     * @Return: CommonResponseBody
     */
    @PostMapping("/saveAttendanceApprove")
    @RecordLog(name = "考勤审批添加")
    @SaCheckPermission("/attendance/attendanceApprove/saveAttendanceApprove")
    public CommonResponseBody saveAttendanceApprove(@RequestBody SmartParkAttendanceApproveQO smartParkAttendanceApproveQO){
        return smartParkAttendanceApproveService.saveAttendanceApprove(smartParkAttendanceApproveQO);
    }


    /**
     * 审批详情
     * @Description:  审批详情
     * @Author: ChenYong
     * @Date: 2021/8/10 0010
     * @param smartParkAttendanceApproveQO:
     * @Return: CommonResponseBody
     */
    @PostMapping("/AttendanceApproveDetails")
    @RecordLog(name = "考勤审批详情")
    @SaCheckPermission("/attendance/attendanceApprove/AttendanceApproveDetails")
    public  CommonResponseBody<SmartParkAttendanceApproveVO> AttendanceApproveDetails(@RequestBody SmartParkAttendanceApproveQO smartParkAttendanceApproveQO){
        return smartParkAttendanceApproveService.AttendanceApproveDetails(smartParkAttendanceApproveQO);
    }

    /**
     * 审批处理
     * @Description:  审批处理
     * @Author: ChenYong
     * @Date: 2021/8/10 0010
     * @param smartParkAttendanceApproveQO:
     * @Return: CommonResponseBody
     */
    @PostMapping("/AttendanceApproveHandle")
    @RecordLog(name = "考勤审批处理")
    @SaCheckPermission("/attendance/attendanceApprove/AttendanceApproveHandle")
    public CommonResponseBody AttendanceApproveHandle(@RequestBody SmartParkAttendanceApproveQO smartParkAttendanceApproveQO) {
        return smartParkAttendanceApproveService.AttendanceApproveHandle(smartParkAttendanceApproveQO);
    }

}
